package com.customer.mapper;

import com.customer.entity.AICharacter;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import java.util.List;

/**
 * AI角色Mapper接口
 */
@Mapper
public interface AICharacterMapper {
    
    /**
     * 查询所有角色列表
     */
    @Select("select * from ai_character order by create_time asc")
    List<AICharacter> selectAllPublicCharacters();
    
    /**
     * 根据角色key查询角色信息
     */
    @Select("select * from ai_character where role_key = #{roleKey}")
    AICharacter selectByRoleKey(String roleKey);

    /**
     * 搜索角色
     */
    @Select("select * from ai_character where (character_name like concat('%', #{keyword}, '%') or description like concat('%', #{keyword}, '%'))")
    List<AICharacter> searchCharacters(String keyword);

}